<template>
	<view style="width: 750rpx;position: fixed;z-index: 999;">
		<uni-notice-bar :speed="50" show-icon scrollable show-close :text="noticeText" :v-show="noticeIsShow" />
	</view>
</template>

<script>
	export default {
		name: "noticeBar",
		data() {
			return {
				noticeIsShow: true,
				noticeText: 'hello world'
			};
		},
		methods: {
			async getNotice() {
				const db = uniCloud.database();
				//只获取最新的一条数据，数据库有多条数据也只要展示一条
				let res = await db.collection('notice-bar').limit(1).get()
				this.noticeIsShow = res.result.data[0].is_show
				this.noticeText = res.result.data[0].text
			},
		}
	}
</script>